package com.mmy.service.impl.sys;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.mmy.dao.sys.TSysUserRepository;
import com.mmy.domain.sys.TSysUser;
import com.mmy.service.sys.TSysUserService;

@Service
public class TSysUserServiceImpl implements TSysUserService {
	@Autowired
	private TSysUserRepository tSysUserRepository;

	/*
	 * 通过手机号查询用户 public List<TSysUser> findByUserMobile(String cUserMobile) {
	 * 
	 * return tSysUserRepository.findByUserMobile(cUserMobile);
	 * 
	 * }
	 * 
	 * 通过邮箱查询用户 public List<TSysUser> findByEmail(String cMail) {
	 * 
	 * return tSysUserRepository.findByEmail(cMail);
	 * 
	 * }
	 * 
	 * 通过用户账号查询用户 public List<TSysUser> findByUserAccount(String cUserAccount) {
	 * 
	 * return tSysUserRepository.findByUserAccount(cUserAccount);
	 * 
	 * }
	 */

	/* 通过身份证号查询用户 */
	public List<TSysUser> findByIdentity(String cIdentity) {

		// return tSysUserRepository.findByIdentity(cIdentity);
		return null;
	}

	/* 获得用户最大编号 */
	public Object getMaxMemberUserID() {
		// TODO Auto-generated method stub
		return tSysUserRepository.getMaxMemberUserID();
	}

	/* 获得用员工最大编号 */
	public Object getMaxStaffUserID() {
		// TODO Auto-generated method stub
		return tSysUserRepository.getMaxStaffUserID();
	}

	/* 获得用员工导游最大编号 */
	public Object getMaxGuideUserID() {
		// TODO Auto-generated method stub
		return tSysUserRepository.getMaxGuideUserID();
	}

	/* 获得用员工司机最大编号 */
	public Object getMaxDriverUserID() {
		// TODO Auto-generated method stub
		return tSysUserRepository.getMaxDriverUserID();
	}

	/* 获得用员工主播最大编号 */
	public Object getMaxAnchorUserID() {
		// TODO Auto-generated method stub
		return tSysUserRepository.getMaxAnchorUserID();
	}

	/* 注册 */
	public void save(int userID) {
		// TODO Auto-generated method stub
		tSysUserRepository.save(userID);
	}

	public TSysUser save(TSysUser tSysUser) {
		// TODO Auto-generated method stub
		return tSysUserRepository.save(tSysUser);
	}

	/* 查找所有游客 */
	public List<TSysUser> findALLMember() {
		// TODO Auto-generated method stub
		return tSysUserRepository.findALLMember();
	}

	/* 查找所有非游客 */
	public List<TSysUser> findALLStaff() {
		// TODO Auto-generated method stub
		return tSysUserRepository.findALLStaff();
	}

	/* 查找该手机号的游客 */
	public List<TSysUser> findMemberByUserMobile(String cUserMobile) {
// TODO Auto-generated method stub
		return tSysUserRepository.findMemberByUserMobile(cUserMobile);

	}

	/* 查找该性别的游客 */
	public List<TSysUser> findMemberBySex(Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findMemberBySex(bSex);

	}

	/* 查找该手机号该性别的游客 */
	public List<TSysUser> findMemberByUserMobileAndSex(String cUserMobile, Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findMemberByUserMobileAndSex(cUserMobile, bSex);

	}

	/* 查找该姓名的游客 */
	public List<TSysUser> findMemberByUserName(String cUserName) {
// TODO Auto-generated method stub
		return tSysUserRepository.findMemberByUserName(cUserName);

	}

	/* 查找该姓名该手机号的游客 */
	public List<TSysUser> findMemberByUserNameAndUserMobile(String cUserName, String cUserMobile) {
// TODO Auto-generated method stub
		return tSysUserRepository.findMemberByUserNameAndUserMobile(cUserName, cUserMobile);
	}

	/* 查找该姓名该性别的游客 */
	public List<TSysUser> findMemberByUserNameAndSex(String cUserName, Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findMemberByUserNameAndSex(cUserName, bSex);
	}

	/* 查找该姓名该手机号该性别的游客 */
	public List<TSysUser> findMemberByUserNameAndUserMobileAndSex(String cUserName, String cUserMobile, Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findMemberByUserNameAndUserMobileAndSex(cUserName, cUserMobile, bSex);
	}

	/* 查找该手机号的用户 */
	public List<TSysUser> findStaffByUserMobile(String cUserMobile) {
// TODO Auto-generated method stub
		return tSysUserRepository.findStaffByUserMobile(cUserMobile);

	}

	/* 查找该性别的用户 */
	public List<TSysUser> findStaffBySex(Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findStaffBySex(bSex);

	}

	/* 查找该手机号该性别的用户 */
	public List<TSysUser> findStaffByUserMobileAndSex(String cUserMobile, Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findStaffByUserMobileAndSex(cUserMobile, bSex);

	}

	/* 查找该姓名的用户 */
	public List<TSysUser> findStaffByUserName(String cUserName) {
// TODO Auto-generated method stub
		return tSysUserRepository.findStaffByUserName(cUserName);

	}

	/* 查找该姓名该手机号的用户 */
	public List<TSysUser> findStaffByUserNameAndUserMobile(String cUserName, String cUserMobile) {
// TODO Auto-generated method stub
		return tSysUserRepository.findStaffByUserNameAndUserMobile(cUserName, cUserMobile);
	}

	/* 查找该姓名该性别的用户 */
	public List<TSysUser> findStaffByUserNameAndSex(String cUserName, Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findStaffByUserNameAndSex(cUserName, bSex);
	}

	/* 查找该姓名该手机号该性别的用户 */
	public List<TSysUser> findStaffByUserNameAndUserMobileAndSex(String cUserName, String cUserMobile, Byte bSex) {
// TODO Auto-generated method stub
		return tSysUserRepository.findStaffByUserNameAndUserMobileAndSex(cUserName, cUserMobile, bSex);
	}

	/* 查询所有用户 */
	public List<TSysUser> findAll() {
		// TODO Auto-generated method stub
		return tSysUserRepository.findAll();
	}

	/*
	 * public void delByUserID(int iUserID) { // TODO Auto-generated method stub
	 * tSysUserRepository.delByUserID(iUserID); }
	 */

	/* 通过ID查找用户 只有一条 用实体类 不用list */
	public List<TSysUser> findByiUserID(int iUserID) {
		// TODO Auto-generated method stub
		return tSysUserRepository.findByiUserID(iUserID);
	}

	public String findcPassWordBycUserMobile(String cUserMobile) {
		// TODO Auto-generated method stub
		return tSysUserRepository.findcPassWordBycUserMobile(cUserMobile);
	}

	public List<TSysUser> findBycPassWord(String password) {
		// TODO Auto-generated method stub
		return tSysUserRepository.findBycPassWord(password);
	}

	public TSysUser save(List<TSysUser> db_TSysUser) {
		// TODO Auto-generated method stub
		return tSysUserRepository.save(db_TSysUser);
	}

	public List<TSysUser> find(String cUserName, String cUserMobile) {
		// TODO Auto-generated method stub
		return tSysUserRepository.findBycPassWord(cUserName, cUserMobile);
	}

	public void delByCUserName(String cUserName) {
		// TODO Auto-generated method stub
		tSysUserRepository.deleteBycUserName(cUserName);
	}


	public List<TSysUser> findByiUserId(String newid) {
		// TODO Auto-generated method stub
		return tSysUserRepository.findByiUserId(newid);
	}

	public Object getMaxIUserID() {
		// TODO Auto-generated method stub
		return tSysUserRepository.getMaxIUserID();
	}

	public List<TSysUser> findBycIdentity(String cIdentity) {
		// TODO Auto-generated method stub
		return tSysUserRepository.findBycIdentity(cIdentity);
	}

	public void update(int iUseriD, String cUserMobile) {
		// TODO Auto-generated method stub
		tSysUserRepository.update(iUseriD, cUserMobile);
	}

}
